package cn.lsp.sharkmall.mapper;

import cn.lsp.sharkmall.util.PageQueryUtil;
import org.apache.ibatis.annotations.Param;
import cn.lsp.sharkmall.pojo.entity.*;

import java.util.List;

/**
 * @Description: 商品分类
 * @Author: sweeterjava@163.com
 * @Date: 2023/2/13
 * @Time: 00:19
 */
public interface GoodsCategoryMapper {
    int deleteByPrimaryKey(Long categoryId);

    int insert(GoodsCategory record);

    int insertSelective(GoodsCategory record);

    GoodsCategory selectByPrimaryKey(Long categoryId);

    GoodsCategory selectByLevelAndName(
            @Param("categoryLevel") Byte categoryLevel,
            @Param("categoryName") String categoryName);

    int updateByPrimaryKeySelective(GoodsCategory record);

    int updateByPrimaryKey(GoodsCategory record);

    List<GoodsCategory> findGoodsCategoryList(PageQueryUtil pageUtil);

    int getTotalGoodsCategories(PageQueryUtil pageUtil);

    int deleteBatch(Long[] ids);

    List<GoodsCategory> selectByLevelAndParentIdsAndNumber(
            @Param("parentIds") List<Long> parentIds,
            @Param("categoryLevel") int categoryLevel,
            @Param("number") int number);
}
